package com.web.music.impl;

import com.web.music.interfaces.MusicProcessor;
import com.web.music.interfaces.PersistenceHelper;
import com.web.music.interfaces.XmlParser;

/**
 * The common part for all main processor implementations
 */
public class BaseMusicProcessor implements MusicProcessor {		
	
	private XmlParser xmlParser;	
	private PersistenceHelper persistence;
	
	// flag to delete everything from DB
	private boolean cleanDB;
	
	public void execute(){
		System.out.println("BaseMusicProcessor execution started");
		if (isCleanDB()){
			getPersistence().deleteEverything();
		}
	}	

	public XmlParser getXmlParser() {
		return xmlParser;
	}
	public void setXmlParser(XmlParser xmlParser) {
		this.xmlParser = xmlParser;
	}
	public PersistenceHelper getPersistence() {
		return persistence;
	}
	public void setPersistence(PersistenceHelper persistence) {
		this.persistence = persistence;
	}
	public boolean isCleanDB() {
		return cleanDB;
	}
	public void setCleanDB(boolean cleanDB) {
		this.cleanDB = cleanDB;
	}
	
}